{
语法百题 解题报告：
 http://git.oschina.net/et0662/sznoi-grammar/ 
}
var
	a:array[1..11,1..11] of integer;
	i,j,ii,jj,k,n:integer;
begin
	readln(n);
	for i:=1 to n do
	for j:=1 to n do
		a[i,j]:=0;
	a[1,n div 2+1]:=1;
	i:=1;
	j:=n div 2+1;
	k:=2;
	while k<=(n*n) do
	begin
		ii:=i-1;
		jj:=j-1;
		if(ii=0)then
			ii:=n;
		if(jj=0)then
			jj:=n;
		if(a[ii][jj]<>0)then
			i:=i+1
		else
		begin
			i:=ii;
			j:=jj;
		end;
		a[i][j]:=k;
		inc(k);
	end;
	
	for i:=1 to n do
	begin
		for j:=1 to n-1 do
			write(a[i][j],' ');
		writeln(a[i][n]);
	end;	
end.
